import random
print('猜数字游戏开始！')
level=int(input('请输入难度：'))
num=random.randint(1,10**level)
biggest=str(10**level)
print('数的范围为1-'+biggest)
guess = int(input('请输入你猜的数：\n'))
while guess != num:
    if guess > num:
        guess = int(input('大了,请输入你猜的数：\n'))
    if guess < num:
        guess = int(input('小了,请输入你猜的数：\n'))
    if guess == num:
        print('恭喜你猜对了！')
        break
exit(0)